package com.kady.entity;

import com.kady.utils.DateUtil;

import java.util.Date;


/**
 * \* Created with IntelliJ IDEA.
 * \* User: kady
 * \* Date: 2021/3/26
 * \* Time: 19:25
 * \* 千峰JAVA2101班
 * \* Description: 餐桌实体
 * \
 */
public class Table {
    private long tableId;
    private String tableName;
    private byte status;
    private Date bookedTime;
    private String bookedTimeStr;

    public Table() {
    }

    public Table(long tableId, String tableName) {
        this.tableId = tableId;
        this.tableName = tableName;
    }

    public Table(long tableId, String tableName, byte status, Date bookedTime) {
        this.tableId = tableId;
        this.tableName = tableName;
        this.status = status;
        this.bookedTime = bookedTime;
    }

    public long getTableId() {
        return tableId;
    }

    public void setTableId(long tableId) {
        this.tableId = tableId;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public byte getStatus() {
        return status;
    }

    public void setStatus(byte status) {
        this.status = status;
    }

    public Date getBookedTime() {
        return bookedTime;
    }

    public void setBookedTime(Date bookedTime) {
        this.bookedTime = bookedTime;
    }

    public String getBookedTimeStr() {
        return this.bookedTime != null? DateUtil.dateToStr(this.bookedTime,"YYYY-MM-dd HH:mm:ss"):null;
    }

    public void setBookedTimeStr(String bookedTimeStr) {
        this.bookedTimeStr = bookedTimeStr;
    }

    @Override
    public String toString() {
        return "Table{" +
                "tableId=" + tableId +
                ", tableName='" + tableName + '\'' +
                ", status=" + status +
                ", bookedTime=" + bookedTime +
                ", bookedTimeStr='" + bookedTimeStr +
                '}';
    }
}
